import QtQuick          2.12
import QtQuick.Controls 2.4
import QtQuick.Dialogs  1.3
import QtQuick.Layouts  1.11
import QtQuick.Window   2.11

import MControls                1.0
import MPlayer.VideoSettings    1.0

ApplicationWindow {
    id:             mainWindow
    minimumWidth:   Screen.width / 3  // 4:3
    minimumHeight:  minimumWidth * (3 / 4)
    font.family:    "Microsoft YaHei"
    font.pixelSize: 18
    visible:        true

    ColumnLayout {
        width:  mainWindow.width * 0.9
        height: mainWindow.height * 0.9
        anchors.centerIn: mainWindow.contentItem
        spacing: 10

        // Configuration
        GridLayout {
            Layout.fillWidth:   true
            columns:            2
            Label {
                Layout.minimumWidth: implicitWidth
                horizontalAlignment: Text.AlignLeft
                text:                "Media URI: "
            }
            MTextField {
                Layout.fillWidth:   true
                text: VideoSettings.width
            }
        }

        // Video Component
        Rectangle {
            id: videoArea
            Layout.alignment:   Qt.AlignHCenter
            Layout.fillWidth:   true
            Layout.fillHeight:  true
            border.color:       "gray"
            border.width:       1
            color:              "transparent"
            MPlayVideoBackground {
                id:             mainVideo
                objectName:     "videoContent"
                anchors.fill:   parent
                anchors.margins: 5
            }
        }
    }
}
